<template>
  <view class="top" >
    <!-- 添加按钮 -->
    <view class="userInfoCreate">
      <view class="create">
        <u-button
          type="primary"
          text="添加"
          :plain="false"
          shape="circle"
          @click="handleAddUser"
          customStyle="height: 100%;"
        ></u-button>
      </view>
    </view>
    <!-- 搜索框 -->
    <view class="search">
      <u-search
        shape="round"
        placeholder="筛选"
        :animation="true"
        action-text="查找"
        @click="openPopup"
        disabled
      ></u-search>
    </view>
  </view>
</template>
<script>
import { mapMutations } from "vuex";
export default {
  // 获取添加用户按钮标题名称
  props: {
				addPageTitle: {
					type: String,
          required: true
				}
			},
  data() {
    return {
      title:this.addPageTitle
    };
  },
  methods: {
    // 添加用户,弹出层状态函数引入
    ...mapMutations(["handleAdd", "popupState"]),
    /** 添加用户跳转页面 */
    handleAddUser() {
      this.handleAdd(this.title);
    },
    /** 触发搜索栏点击事件(打开弹出层) */
    openPopup() {
      this.popupState(true);
    //   this.reset();
    },
  },
};
</script>
<style lang="scss" scoped>
@import "../../yangLaoAppStyle.scss";
</style>
